<!DOCTYPE html>
<html lang="zh-Hans">
<head>
  <meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=2">
<meta name="theme-color" content="#222">
<meta name="generator" content="Hexo 4.2.1">
  <link rel="apple-touch-icon" sizes="180x180" href="/images/apple-touch-icon-next.png">
  <link rel="icon" type="image/png" sizes="32x32" href="/images/favicon-32x32-next.png">
  <link rel="icon" type="image/png" sizes="16x16" href="/images/favicon-16x16-next.png">
  <link rel="mask-icon" href="/images/logo.svg" color="#222">

<link rel="stylesheet" href="/css/main.css">


<link rel="stylesheet" href="/lib/font-awesome/css/all.min.css">
  <link rel="stylesheet" href="/lib/pace/pace-theme-minimal.min.css">
  <script src="/lib/pace/pace.min.js"></script>

<script id="hexo-configurations">
    var NexT = window.NexT || {};
    var CONFIG = {"hostname":"sophimp.gitee.io","root":"/","scheme":"Pisces","version":"7.8.0","exturl":false,"sidebar":{"position":"left","display":"post","padding":18,"offset":12,"onmobile":false},"copycode":{"enable":false,"show_result":false,"style":null},"back2top":{"enable":true,"sidebar":false,"scrollpercent":true},"bookmark":{"enable":false,"color":"#222","save":"auto"},"fancybox":false,"mediumzoom":false,"lazyload":false,"pangu":false,"comments":{"style":"tabs","active":null,"storage":true,"lazyload":false,"nav":null},"algolia":{"hits":{"per_page":10},"labels":{"input_placeholder":"Search for Posts","hits_empty":"We didn't find any results for the search: ${query}","hits_stats":"${hits} results found in ${time} ms"}},"localsearch":{"enable":false,"trigger":"auto","top_n_per_article":1,"unescape":false,"preload":false},"motion":{"enable":true,"async":false,"transition":{"post_block":"fadeIn","post_header":"slideDownIn","post_body":"slideDownIn","coll_header":"slideLeftIn","sidebar":"slideUpIn"}}};
  </script>

  <meta name="description" content="gentoo使用了2个多月， 更新再编译实在等不了，不过这一折腾过程是有收益的，以后有机会肯定会再玩一玩， 然后现在更重要的是提升生存技能。">
<meta property="og:type" content="article">
<meta property="og:title" content="gentoo使用记录">
<meta property="og:url" content="http://sophimp.gitee.io/2019/11/29/linux/working_with_gentoo/index.html">
<meta property="og:site_name" content="Sophimp&#39;s Space">
<meta property="og:description" content="gentoo使用了2个多月， 更新再编译实在等不了，不过这一折腾过程是有收益的，以后有机会肯定会再玩一玩， 然后现在更重要的是提升生存技能。">
<meta property="article:published_time" content="2019-11-28T23:19:45.000Z">
<meta property="article:modified_time" content="2021-03-15T03:49:47.937Z">
<meta property="article:author" content="Sophimp">
<meta property="article:tag" content="Linux">
<meta property="article:tag" content="Gentoo">
<meta name="twitter:card" content="summary">

<link rel="canonical" href="http://sophimp.gitee.io/2019/11/29/linux/working_with_gentoo/">


<script id="page-configurations">
  // https://hexo.io/docs/variables.html
  CONFIG.page = {
    sidebar: "",
    isHome : false,
    isPost : true,
    lang   : 'zh-Hans'
  };
</script>

  <title>gentoo使用记录 | Sophimp's Space</title>
  






  <noscript>
  <style>
  .use-motion .brand,
  .use-motion .menu-item,
  .sidebar-inner,
  .use-motion .post-block,
  .use-motion .pagination,
  .use-motion .comments,
  .use-motion .post-header,
  .use-motion .post-body,
  .use-motion .collection-header { opacity: initial; }

  .use-motion .site-title,
  .use-motion .site-subtitle {
    opacity: initial;
    top: initial;
  }

  .use-motion .logo-line-before i { left: initial; }
  .use-motion .logo-line-after i { right: initial; }
  </style>
</noscript>

</head>

<body itemscope itemtype="http://schema.org/WebPage">
  <div class="container use-motion">
    <div class="headband"></div>

	
	<script type="text/javascript" src="//cdn.bootcss.com/canvas-nest.js/1.0.0/canvas-nest.min.js"></script>
	

    <header class="header" itemscope itemtype="http://schema.org/WPHeader">
      <div class="header-inner"><div class="site-brand-container">
  <div class="site-nav-toggle">
    <div class="toggle" aria-label="Toggle navigation bar">
      <span class="toggle-line toggle-line-first"></span>
      <span class="toggle-line toggle-line-middle"></span>
      <span class="toggle-line toggle-line-last"></span>
    </div>
  </div>

  <div class="site-meta">

    <a href="/" class="brand" rel="start">
      <span class="logo-line-before"><i></i></span>
      <h1 class="site-title">Sophimp's Space</h1>
      <span class="logo-line-after"><i></i></span>
    </a>
      <p class="site-subtitle" itemprop="description">coding & thinking</p>
  </div>

  <div class="site-nav-right">
    <div class="toggle popup-trigger">
    </div>
  </div>
</div>




<nav class="site-nav">
  <ul id="menu" class="main-menu menu">
        <li class="menu-item menu-item-home">

    <a href="/" rel="section"><i class="fa fa-home fa-fw"></i>Home</a>

  </li>
        <li class="menu-item menu-item-archives">

    <a href="/archives/" rel="section"><i class="fa fa-archive fa-fw"></i>Archives</a>

  </li>
  </ul>
</nav>




</div>
    </header>

    
  <div class="back-to-top">
    <i class="fa fa-arrow-up"></i>
    <span>0%</span>
  </div>
  <div class="reading-progress-bar"></div>

  <a href="https://github.com/sophimp" class="github-corner" title="Follow me on GitHub" aria-label="Follow me on GitHub" rel="noopener" target="_blank"><svg width="80" height="80" viewBox="0 0 250 250" aria-hidden="true"><path d="M0,0 L115,115 L130,115 L142,142 L250,250 L250,0 Z"></path><path d="M128.3,109.0 C113.8,99.7 119.0,89.6 119.0,89.6 C122.0,82.7 120.5,78.6 120.5,78.6 C119.2,72.0 123.4,76.3 123.4,76.3 C127.3,80.9 125.5,87.3 125.5,87.3 C122.9,97.6 130.6,101.9 134.4,103.2" fill="currentColor" style="transform-origin: 130px 106px;" class="octo-arm"></path><path d="M115.0,115.0 C114.9,115.1 118.7,116.5 119.8,115.4 L133.7,101.6 C136.9,99.2 139.9,98.4 142.2,98.6 C133.8,88.0 127.5,74.4 143.8,58.0 C148.5,53.4 154.0,51.2 159.7,51.0 C160.3,49.4 163.2,43.6 171.4,40.1 C171.4,40.1 176.1,42.5 178.8,56.2 C183.1,58.6 187.2,61.8 190.9,65.4 C194.5,69.0 197.7,73.2 200.1,77.6 C213.8,80.2 216.3,84.9 216.3,84.9 C212.7,93.1 206.9,96.0 205.4,96.6 C205.1,102.4 203.0,107.8 198.3,112.5 C181.9,128.9 168.3,122.5 157.7,114.1 C157.9,116.9 156.7,120.9 152.7,124.9 L141.0,136.5 C139.8,137.7 141.6,141.9 141.8,141.8 Z" fill="currentColor" class="octo-body"></path></svg></a>


    <main class="main">
      <div class="main-inner">
        <div class="content-wrap">
          

          <div class="content post posts-expand">
            

    
  
  
  <article itemscope itemtype="http://schema.org/Article" class="post-block" lang="zh-Hans">
    <link itemprop="mainEntityOfPage" href="http://sophimp.gitee.io/2019/11/29/linux/working_with_gentoo/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="image" content="/images/avatar.png">
      <meta itemprop="name" content="Sophimp">
      <meta itemprop="description" content="A dream begin">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="Sophimp's Space">
    </span>
      <header class="post-header">
        <h1 class="post-title" itemprop="name headline">
          gentoo使用记录
        </h1>

        <div class="post-meta">
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="far fa-calendar"></i>
              </span>
              <span class="post-meta-item-text">Posted on</span>

              <time title="Created: 2019-11-29 07:19:45" itemprop="dateCreated datePublished" datetime="2019-11-29T07:19:45+08:00">2019-11-29</time>
            </span>
              <span class="post-meta-item">
                <span class="post-meta-item-icon">
                  <i class="far fa-calendar-check"></i>
                </span>
                <span class="post-meta-item-text">Edited on</span>
                <time title="Modified: 2021-03-15 11:49:47" itemprop="dateModified" datetime="2021-03-15T11:49:47+08:00">2021-03-15</time>
              </span>
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="far fa-folder"></i>
              </span>
              <span class="post-meta-item-text">In</span>
                <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
                  <a href="/categories/Linux/" itemprop="url" rel="index"><span itemprop="name">Linux</span></a>
                </span>
            </span>

          
            <span class="post-meta-item" title="Views" id="busuanzi_container_page_pv" style="display: none;">
              <span class="post-meta-item-icon">
                <i class="fa fa-eye"></i>
              </span>
              <span class="post-meta-item-text">Views: </span>
              <span id="busuanzi_value_page_pv"></span>
            </span>
            <div class="post-description">gentoo使用了2个多月， 更新再编译实在等不了，不过这一折腾过程是有收益的，以后有机会肯定会再玩一玩， 然后现在更重要的是提升生存技能。</div>

        </div>
      </header>

    
    
    
    <div class="post-body" itemprop="articleBody">

      
        <h2 id="概念"><a href="#概念" class="headerlink" title="概念"></a>概念</h2><p>整个 portage 用python写的</p>
<p>portage</p>
<pre><code>是一个架构，gentoo的工作就是通过portage来完成的， 用来配置，安装, 管理应用

1. configuration directives

全局的默认的配置            /usr/share/portage/config/make.globals
不同架构的默认配置文件指向  /etc/portage/make.profile
用户定制的配置文件            /etc/portage/make.conf 这个文件会覆盖上面两个默认配置， 配置的示例在 /usr/share/portage/config/make.conf.example
系统存放的profile路径        /var/db/repos/gentoo, 

2. 用户配置 

在/etc/portage 中修改配置文件， 不鼓励直接覆盖环境变量

用户可创建的文件/文件夹
* package.mask
    portage永不安装的应用
* package.umask
    gentoo 开发者非常不建议安装(默认mask)的软件， 可以通过这里打开
* package.accpet_keywords
    不适合当前系统架构的应用可以通过此配置强制安装
* package.use 
    为每个应用配置特定的 use flags, 而不影响其他应用</code></pre><p>ebuild</p>
<pre><code>是用来管理所有应用的版本信息的， 对应有一个仓库， 同步的软件源为 gentoo-portage</code></pre><p>gentoo</p>
<pre><code>自身有一个软件源，GENTOO_MIRRORS, 这个是用来下载什么的呢？ 应用是从gentoo, gentoo-portage 哪个镜像里下载呢？ </code></pre><h2 id="任务列表"><a href="#任务列表" class="headerlink" title="任务列表"></a>任务列表</h2><ol>
<li><p>正常安装</p>
<p> emerge –search 搜索</p>
<p> emerge -av 安装</p>
<p> 可以临时带USE, 也可以全局配置. 在/etc/portage/mask(unmask)</p>
</li>
<li><p>mask, unmask</p>
<p> 屏蔽/不屏蔽 特定的版本</p>
</li>
<li><p>安装稳定版本</p>
<p> 根据make.conf中的 ACCEPT_KEYWORDS 来判断的, ACCEPT_KEYWORDS=”amd64”是稳定版本, ACCEPT_KEYWORDS=”~amd64”, 是测试版本</p>
</li>
<li><p>安装 binary 版本</p>
</li>
<li><p>日志查看</p>
</li>
<li><p>进程查看</p>
<p> ps -ano, 查看所有运行进程</p>
</li>
<li><p>网络查看</p>
<p> ping, route, netstat</p>
</li>
<li><p>将ntfs 格式化成ext4, 并将两个分区合并</p>
<p> ntfs 直接使用 mkfs.ext4 /dev/sdb6 来格式化， 倒时可以格式化成功， 但是使用fdisk -l 查看的时候， 还是显示的 ntfs格式。 但是可以使用ext4挂载上， 可以创建文件。<br> 显示ntfs信息是因为 sdb的索引问题吗？ 实际删除sdb就可以了？ </p>
<p> 使用fdisk来分区<br> fdisk -u /dev/sdb, 可以查看sdb下的所有分区。这样一来， /dev/sdb就不可以再重写了， 那么就会一直有 /dev/sdb1 W95 Ext’d (LBA) 的分区提示，可不可以删除sdb1呢？ 应该是可以的， 因为操作的是/dev/sdb</p>
<p> 然后就好办了， 可以查看到/dev/sdb下的所有分区， 就直接按命令来操作， d, 删除，n 创建，w 保存， 然后再mkfs.ext4 /dev/sdb6格式化。 </p>
</li>
<li><p>滚动更新</p>
</li>
</ol>
<figure class="highlight sh"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment"># 更新软件仓库</span></span><br><span class="line">emerge --sync <span class="comment"># 调用 rsync 增量更新</span></span><br><span class="line"></span><br><span class="line">emerge-webrsync <span class="comment"># 使用web请求方式更新， 针对防火墙阻止了rsync更新的方式</span></span><br><span class="line"></span><br><span class="line">配置镜像</span><br><span class="line">在/etc/portage/make.conf 中GENTOO_MIRRORS</span><br><span class="line">在/etc/portage/repos.conf/gentoo.conf 中配置 sync-uri=</span><br><span class="line"></span><br><span class="line">清华的镜像也是慢， 换成科大的， 貌似好点，就差点因为这个， 要换archlinux了， 网速实现太慢， 没法玩。 </span><br><span class="line"></span><br><span class="line"><span class="comment"># 更新 portage树</span></span><br><span class="line">emerge --update --deep --with-bdeps=y --newuse --ask @world</span><br></pre></td></tr></table></figure>
<pre><code>emerge --sync 在换了镜像源后， 之前的sync不起作用？ 为何在emerge --sync 已经sync后， 再update 还是不行呢？ 这样的表现推测原因是换了源，清空之前的同步？ 还是因为太久没有同步了。 
已经 emerge --sync 三次了。 </code></pre><p>10.</p>
<ol start="11">
<li><h2 id="复盘"><a href="#复盘" class="headerlink" title="复盘"></a>复盘</h2></li>
</ol>
<p>Mon Feb 10 10:10:17 CST 2020</p>
<pre><code>搞gentoo持续的周期, 从2019.9.10 开始, 刚好5个月了. 最开始由移植nx611j 开始起念头, 也不过是5个月, 至少gentoo现在是可以使用了. 结果看上去也没那么糟.

最开始想学gentoo, 是对linux有一个更好的了解, 继而对移植android 更加得心应手, 最好发现远远没有那么简单. 

就像最开始学习网络一样, 学得做黑客, 学习网络是必不可少的, 其实实际应用中, 也不过是对路由器的简单配置, vpn 的配置. 现在多了一些网络相关的开发.  黑客的成长之路, 网络仅仅一段. 

现在想对gentoo的学习做一个复盘, 到目前为止, 知识点还是散的, gentoo的下一步学习, 也停滞了三个月了, 这样一算, 真正用来学习gentoo的时间, 也不过是2个月. 但是因为学习gentoo而分心学习其他的知识也是必不可少的. 最根本的原因, 我的基础太薄弱了, 要补的东西太多了. </code></pre><p>Sat 15 Feb 2020 10:57:10 PM CST</p>
<pre><code>好险因为网络问题，抛弃gentoo, 去折腾archlinux 了， 但是打开archlinux 同样也是很慢， 下载也很慢. 编译可以忍受， 网络慢是真受不了， 网络慢不可控， 经常会失败。 
怎么就忘记了镜像了呢？
gentoo 下载有一个镜像， 是在make.conf 中配置 GENTOO_MIRRORS, 
gentoo-portage同样有一个镜像, 是在 /etc/portage/repos.conf/gentoo.conf 中配置 sync-uri

今天滚动升级， 距离上次升级已经过了119天了。这段时间学习 apue, 疫情，春节，是有很多天没碰电脑了， 昨天立了一个目标，先坚持一个月， 不再碰娱乐的项目：刷剧，刷直播，刷知乎，刷八卦， 玩游戏。
今天已经坚持一天了，这种感觉也体会过， 时间变多了， 一天的时间变长了， 干活不拖拉了， 也还有时间学会习， 思考了。 这是一个好的开始。 
一天的时间， 令人烦燥的时间点太多了， 过一会就会变得无所适从， 不知道下一步该干些什么了。 也是没谁了。 

gentoo的环境目前也算是可以用了， 接下来继续配置一下开发环境。 边开发边折腾吧。 现在直接折腾awesome，目标太不明确， 效率太低，基本的使用套路已经清楚。 就以配置开发环境来建任务列表。 
不管是使用体验上的， 还是开发必须的环境。 任务名称都记录下来， 致于实现与否， 看优先级。 </code></pre>
    </div>

    
    
    

      <footer class="post-footer">
          <div class="post-tags">
              <a href="/tags/Linux/" rel="tag"># Linux</a>
              <a href="/tags/Gentoo/" rel="tag"># Gentoo</a>
          </div>

        


        
    <div class="post-nav">
      <div class="post-nav-item">
    <a href="/2019/11/28/android/advanced/phone_message_architecture_analysis/" rel="prev" title="Android短信与电话模块分析">
      <i class="fa fa-chevron-left"></i> Android短信与电话模块分析
    </a></div>
      <div class="post-nav-item">
    <a href="/2019/12/11/thought/The_36_questions_that_lead_to_love/" rel="next" title="36个问题让你与陌生人相爱">
      36个问题让你与陌生人相爱 <i class="fa fa-chevron-right"></i>
    </a></div>
    </div>
      </footer>
    
  </article>
  
  
  



          </div>
          

<script>
  window.addEventListener('tabs:register', () => {
    let { activeClass } = CONFIG.comments;
    if (CONFIG.comments.storage) {
      activeClass = localStorage.getItem('comments_active') || activeClass;
    }
    if (activeClass) {
      let activeTab = document.querySelector(`a[href="#comment-${activeClass}"]`);
      if (activeTab) {
        activeTab.click();
      }
    }
  });
  if (CONFIG.comments.storage) {
    window.addEventListener('tabs:click', event => {
      if (!event.target.matches('.tabs-comment .tab-content .tab-pane')) return;
      let commentClass = event.target.classList[1];
      localStorage.setItem('comments_active', commentClass);
    });
  }
</script>

        </div>
          
  
  <div class="toggle sidebar-toggle">
    <span class="toggle-line toggle-line-first"></span>
    <span class="toggle-line toggle-line-middle"></span>
    <span class="toggle-line toggle-line-last"></span>
  </div>

  <aside class="sidebar">
    <div class="sidebar-inner">

      <ul class="sidebar-nav motion-element">
        <li class="sidebar-nav-toc">
          Table of Contents
        </li>
        <li class="sidebar-nav-overview">
          Overview
        </li>
      </ul>

      <!--noindex-->
      <div class="post-toc-wrap sidebar-panel">
          <div class="post-toc motion-element"><ol class="nav"><li class="nav-item nav-level-2"><a class="nav-link" href="#概念"><span class="nav-number">1.</span> <span class="nav-text">概念</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#任务列表"><span class="nav-number">2.</span> <span class="nav-text">任务列表</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#复盘"><span class="nav-number">3.</span> <span class="nav-text">复盘</span></a></li></ol></div>
      </div>
      <!--/noindex-->

      <div class="site-overview-wrap sidebar-panel">
        <div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person">
    <img class="site-author-image" itemprop="image" alt="Sophimp"
      src="/images/avatar.png">
  <p class="site-author-name" itemprop="name">Sophimp</p>
  <div class="site-description" itemprop="description">A dream begin</div>
</div>
<div class="site-state-wrap motion-element">
  <nav class="site-state">
      <div class="site-state-item site-state-posts">
          <a href="/archives/">
        
          <span class="site-state-item-count">86</span>
          <span class="site-state-item-name">posts</span>
        </a>
      </div>
      <div class="site-state-item site-state-categories">
            <a href="/categories/">
        <span class="site-state-item-count">19</span>
        <span class="site-state-item-name">categories</span></a>
      </div>
      <div class="site-state-item site-state-tags">
            <a href="/tags/">
        <span class="site-state-item-count">89</span>
        <span class="site-state-item-name">tags</span></a>
      </div>
  </nav>
</div>
  <div class="links-of-author motion-element">
      <span class="links-of-author-item">
        <a href="https://github.com/sophimp" title="GitHub → https:&#x2F;&#x2F;github.com&#x2F;sophimp" rel="noopener" target="_blank"><i class="fab fa-github fa-fw"></i>GitHub</a>
      </span>
      <span class="links-of-author-item">
        <a href="mailto:sophimp2020@126.com" title="E-Mail → mailto:sophimp2020@126.com" rel="noopener" target="_blank"><i class="fa fa-envelope fa-fw"></i>E-Mail</a>
      </span>
  </div>



      </div>

    </div>
  </aside>
  <div id="sidebar-dimmer"></div>


      </div>
    </main>

    <footer class="footer">
      <div class="footer-inner">
        

        

<div class="copyright">
  
  &copy; 
  <span itemprop="copyrightYear">2021</span>
  <span class="with-love">
    <i class="fa fa-heart"></i>
  </span>
  <span class="author" itemprop="copyrightHolder">Sophimp</span>
</div>

<!--
  <div class="powered-by">Powered by <a href="https://hexo.io/" class="theme-link" rel="noopener" target="_blank">Hexo</a> & <a href="https://pisces.theme-next.org/" class="theme-link" rel="noopener" target="_blank">NexT.Pisces</a>
  </div>
-->

        
<div class="busuanzi-count">
  <script async src="https://busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script>
    <span class="post-meta-item" id="busuanzi_container_site_uv" style="display: none;">
      <span class="post-meta-item-icon">
        <i class="fa fa-user"></i>
      </span>
      <span class="site-uv" title="Total Visitors">
        <span id="busuanzi_value_site_uv"></span>
      </span>
    </span>
    <span class="post-meta-divider">|</span>
    <span class="post-meta-item" id="busuanzi_container_site_pv" style="display: none;">
      <span class="post-meta-item-icon">
        <i class="fa fa-eye"></i>
      </span>
      <span class="site-pv" title="Total Views">
        <span id="busuanzi_value_site_pv"></span>
      </span>
    </span>
</div>








      </div>
    </footer>
  </div>

  
  <script src="/lib/anime.min.js"></script>
  <script src="/lib/velocity/velocity.min.js"></script>
  <script src="/lib/velocity/velocity.ui.min.js"></script>

<script src="/js/utils.js"></script>

<script src="/js/motion.js"></script>


<script src="/js/schemes/pisces.js"></script>


<script src="/js/next-boot.js"></script>




  















  

  

</body>
</html>
